<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

//抽奖
Route::group([
    'middleware' => ['web', /*'wechat.user', 'focusCheck'*/],
    'prefix' => 'lottery',
], function () {
    Route::get('/index',
        ['as' => 'lottery.index', 'uses' => 'LotteryController@index']);
    Route::post('/lotteryPost', [
        'as' => 'lottery.lotteryPost',
        'uses' => 'LotteryController@lotteryPost',
    ]);

    Route::get('/showPrize',
        ['as' => 'lottery.showPrize', 'uses' => 'LotteryController@showPrize']);
    Route::get('/prizeList',
        ['as' => 'lottery.prizeList', 'uses' => 'LotteryController@prizeList']);
    Route::get('/getPrize/{openID}',
        ['as' => 'lottery.getPrize', 'uses' => 'LotteryController@getPrize']);
    Route::post('/getPrizePost', [
        'as' => 'lottery.getPrizePost',
        'uses' => 'LotteryController@getPrizePost',
    ]);
    Route::get('/success',
        ['as' => 'lottery.success', 'uses' => 'LotteryController@success']);

    //线下领奖记录
    Route::get('/getPrizeByScan', [
        'as' => 'lottery.getPrizeByScan',
        'uses' => 'LotteryController@getPrizeByScan',
    ]);
    Route::post('/getPrizeByScanPost', [
        'as' => 'lottery.getPrizeByScanPost',
        'uses' => 'LotteryController@getPrizeByScanPost',
    ]);

});
